package com.dingwen.treasure.open.api.pub.service;

import com.dingwen.treasure.open.api.pub.bo.YueBo;

import java.util.List;

/**
 * 微信公众号服务
 *
 * @author dingwen
 * @date 2022/12/28
 */
public interface WechatPubService {

    String TOKEN_KEY = "access_token";
    String DATA_KEY = "data";
    String OPEN_IDS_KEY  ="openid";

    String GRANT_TYPE_KEY  ="grant_type";
    String APPID_KEY  ="appid";
    String SECRET_KEY  ="secret";
    String ERR_CODE_KEY  ="errcode";

    Integer TOKEN_EXPIRED_CODE = 42001;

    Integer SUCCESS_CODE = 0;


    /**
     * 获取令牌
     *
     * @return {@link String}
     */
    String fetchToken();


    /**
     * 获取开放id集合（关注改微信公众号的用户id列表）
     *
     * @return {@link List}<{@link String}>
     */
    List<String> fetchOpenIds();

    /**
     * 推送模版消息For月
     *
     * @param morningBo 模版对象
     * @return boolean
     */
    boolean pushTemplateMsgForYue(YueBo morningBo);
}
